/**
 * 后台首页
 */
var React = require("react");
var {Button,Grid,Row,Col} = require("react-bootstrap");
var {Util,ListPage} = require("flower");
class Home extends ListPage{

    constructor(props){
        super(props);
        this.state = {
            num:null
        };
    }
    componentDidMount(){
        var num = Util.get("/numAll");
        this.setState({
            num:num
        });
    }

    title(){
        var data = [
            {name:"首页",href:"#"}
        ];
        return this.cbb(data);
    }

    option(){
        return null;
    }

    clickNumA(flag){
        Util.goto("/load/admin/"+flag+"/Index.jsx");
    }

    content(){
        if(this.state.num == null){
            return null;
        }
        return <div>
                <div className="grid-numdiv" style={{backgroundColor:"#ef7390"}}>
                    <a className="grid-numa" href="#" onClick={this.clickNumA.bind(this,"sort")}>{this.state.num.sort}</a> 个分类
                </div>
                <div className="grid-numdiv" style={{backgroundColor:"#337ab7"}}>
                    <a className="grid-numa" href="#" onClick={this.clickNumA.bind(this,"grid")}>{this.state.num.grid}</a> 张卡片
                </div>
                <div className="grid-numdiv" style={{backgroundColor:"#77de7f"}}>
                    <a className="grid-numa" href="#" onClick={this.clickNumA.bind(this,"tag")}>{this.state.num.tag}</a> 个标签
                </div>
            </div>
    }
}
module.exports = Home;